<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<!--<input type="hidden" id="lineId" th:value="*{lineId}"/>-->
<input type="hidden" id="byqId" th:value="*{byqId}"/>
<input type="hidden" id="byqName" th:value="*{byqName}"/>
<!--<input type="hidden" id="pointId" th:value="*{pointId}"/>-->
<!--<input id="deviceIdArray" name="deviceIdArray" type="hidden">-->
     <div class="container-div">
		<div class="row">
			<div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-warning" onclick="exportTz()">
					<i class="fa fa-download"></i> 导出台账
				</a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">

		var prefix = ctx + "assets/ThyDetiail";

//        var pointId = $("#pointId").val();	//	点位ID
//        var lineId = $("#lineId").val();	//	线路ID
        var byqId = $("#byqId").val();		//	变压器ID
        var byqName = $("#byqName").val();		//


        $(function() {
            var options = {
                url: prefix + "/listTZ?byqId="+byqId,
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove2Id",
				exportUrl: prefix + "/export",
                showSearch:false,		//是否显示检索信息
                showRefresh:false,		//是否显示刷新按钮
                showToggle:false,		//是否显示详细视图和列表视图的切换按钮
                showColumns:false,		//是否显示隐藏某列下拉框
                sortable:false,		//是否启用排序
                pagination: false,		//禁用分页插件
                rowHeight:12,
                modalName: "配电设备基类",
//		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : '',
					visible: false
				},
                    {
                        field : 'byqId',
                        title : '变压器ID',
                        sortable: false,
                        visible: false
                    },{
                        field : 'byqName',
                        title : '变压器名称',
                        sortable: false,
                        visible: false
                    },
				{
					field : 'deviceID',
					title : '所属设备ID',
					sortable: false,
                    visible: false
				},{
					field : 'deviceName',
					title : '所属设备名',
					sortable: false
				},
				{
					field : 'newRu',
					title : '单位',
					sortable: false
				},
				{
					field : 'num',
					title : '数量',
					sortable: false
				},

				{
					field : 'factroy',
					title : '厂家',
					sortable: false
				},
				{
					field : 'model',
					title : '型号',
					sortable: false
				},
				{
					field : 'cjTime',
					title : '出厂日期',
					sortable: false
				},
				{
					field : 'tyTime',
					title : '投运日期',
					sortable: false
				},
				{
					field : 'ywDept',
					title : '运维部门',
					sortable: false
				},
				{
					field : 'ywBz',
					title : '运维编组',
					sortable: false
				},
				{
					field : 'ccCode',
					title : '出厂编号',
					sortable: false
				}]
            };
            $.table.init(options);
        });


        function exportTz() {
            var url = ctx+ "assets/exportDetiail_Excel/LineAssets";
            $.ajax({
                type : "POST",
                url : url,
                data : {
                    "id":byqId
                },
                error : function(request) {
                    $.modal.alertError("导出数据错误，请联系管理员！");
                },
                success : function(data) {
                    var fileName = byqName+"-台账表";
                    window.location.href = ctx + "assets/exportDetiail_Excel/expLineAssets?fileName=" + fileName+ "&id=" + byqId+ "&delete=" + true;
                }
            });

        }


    </script>
</body>
</html>